<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn"
           uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@page isELIgnored="false" %>

<!--news-->
<div class="am-g am-container newatype">

    <div class="star am-container mcenter">
        <span style="font-size: 180%;">
            <img src="${base_static}/images/star.png"><a
                href="${domain_name}category/${cate_info._id}">${cate_info.name}</a>
        </span>
    </div>

    <c:set var="flag" value="true"/>

    <c:forEach items="${rank_data}" var="siteEntity" varStatus="sn">
        <c:if test="${flag}">
            <div class="am-u-sm-12 am-u-md-12 am-u-lg-4 oh" style="float: left;">
                <div data-am-widget="titlebar" class="am-titlebar am-titlebar-default"
                     style="border-bottom: 0px; margin-bottom: -10px; margin-top:0;">
                    <h2 class="am-titlebar-title ">
                            ${siteEntity.key.name}
                    </h2>
                    <nav class="am-titlebar-nav"/>
                </div>
                <div data-am-widget="list_news"
                     class="am-list-news am-list-news-default news">
                    <div class="am-list-news-bd">
                        <ul class="am-list">
                            <c:set var="rank_flag" value="true"/>

                            <c:forEach items="${siteEntity.value}" var="rank"
                                       varStatus="rankStatus">

                                <c:if test="${rank_flag}">
                                    <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"
                                        data-am-scrollspy="{animation:'fade'}" style="padding-top:
                                    0.5rem; padding-bottom: 0.5rem;">

                                        <div class=" am-u-sm-13 am-list-main">
                                            <h6 class="am-list-item-hd" style="overflow: hidden;
                                        display: inline" title="${rank.desc}">
                                                <c:set var="max_index" value="${rank.desc.length() >
                                             19? 19 : rank.desc.length() - 1}"/>
                                                <c:if test="${rank.content != null &&
                                                rank.content != ''}">
                                                    <a href="${domain_name}/ranking/${rank._id}"
                                                       target="_blank">${rankStatus.index + 1}.
                                                        &nbsp;
                                                            ${rank.desc.substring(0, max_index)}
                                                    </a>
                                                </c:if>
                                                <c:if test="${rank.content == null or
                                                        rank.content == ''}">
                                                    <a href="${rank.url}"
                                                       target="_blank">${rankStatus.index + 1}.
                                                        &nbsp;
                                                            ${rank.desc.substring(0, max_index)}
                                                    </a>
                                                </c:if>
                                            </h6>
                                        </div>

                                    </li>
                                </c:if>
                                <c:if test="${rankStatus.index eq 9}"> <c:set
                                        var="rank_flag"
                                        value="false"/></c:if>
                            </c:forEach>

                        </ul>
                    </div>
                </div>
            </div>
        </c:if>
        <c:if test="${sn.index eq 2}"> <c:set var="flag" value="false"/>
        </c:if>
    </c:forEach>

</div>
